package com.bootx.officialAccount.entity;

import com.bootx.entity.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.OneToMany;
import jakarta.validation.constraints.NotEmpty;

import java.util.ArrayList;
import java.util.List;

/**
 * @author black
 */
@Entity
public class Material extends BaseEntity<Long> {


    @NotEmpty
    @Column(unique = true, nullable = false,updatable = false)
    private String mediaId;

    private Long updateTime;

    private String name;

    private String url;

    @OneToMany(mappedBy = "material",fetch = FetchType.LAZY)
    private List<NewsItem> content = new ArrayList<>();

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<NewsItem> getContent() {
        return content;
    }

    public void setContent(List<NewsItem> content) {
        this.content = content;
    }
}
